<template>
  <div class="member-message">
    <XtxTabs v-model="activeName" @tab-click="tabClick">
      <XtxTabsPanel v-for="item in messageType" :key="item.name" :label="item.label" :name="item.name"></XtxTabsPanel>
    </XtxTabs>
    <div class="message-list">
      <div v-if="loading" class="loading"></div>
      <div class="none">当前暂无此类消息</div>
    </div>
  </div>
</template>

<script>
import { messageType } from '@/api/constant'
import { reactive, ref } from 'vue'
export default {
  name: 'MemberMessage',
  setup () {
    const activeName = ref('activities')
    // 点击选项卡
    const tabClick = ({ index }) => {
      reqParams.page = 1
      reqParams.messageType = index + 1
    }
    // 查询订单参数
    const reqParams = reactive({
      page: 1,
      pageSize: 5,
      messageType: 1
    })
    const loading = ref(false)
    return { activeName, tabClick, messageType, reqParams, loading }
  }
}
</script>

<style lang="less" scoped>
.member-message {
  height: 100%;
  background: #fff;
}
.message-list {
  padding: 20px;
  min-height: 400px;
  position: relative;
}
.loading {
  height: 100%;
  width: 100%;
  position: absolute;
  left: 0;
  top: 0;
  background: rgba(255,255,255,.9) url(../../../assets/images/loading.gif) no-repeat center;
}
.none {
  height: 400px;
  text-align: center;
  line-height: 400px;
  color: #999;
}
</style>
